package com.hankol.newretail.adapter

import android.widget.ImageView
import com.baselibrary.Constants
import com.baselibrary.extension.checkValue
import com.baselibrary.router.ActivityRouter
import com.baselibrary.utils.ARouterUtils
import com.baselibrary.utils.GlideUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.newretail.R
import com.hankol.newretail.bean.MallLabelBean
import com.hankol.newretail.bean.goods_details.MallProductGiftCommodityVo
import java.util.HashMap

/*赠品优惠*/
class GoodsGiftCartAdapter : BaseQuickAdapter<MallProductGiftCommodityVo, BaseViewHolder>(R.layout.item_gift_content_with_arrow) {

    override fun convert(helper: BaseViewHolder, item: MallProductGiftCommodityVo) {
        helper.setText(R.id.tv_gift_good_name,item.spuName)
        helper.setText(R.id.tv_gift_good_scale,"x️${item.presentNum}")
        helper.itemView.setOnClickListener {
            val map = HashMap<String, Any>()
            map[Constants.GOODS_DETAIL_ID] = item.spuId
            map[Constants.GOODS_SKU_ID] = item.skuId
            map[Constants.GOODS_DETAIL_SOURCE] = "购物车"
            ARouterUtils.jump(ActivityRouter.NEW_RETAIL.GOODS_DETAUILS, map)
        }
    }
}